<?php


namespace app\common\server;

class Sms
{
	public static function code($channel_type, $config, $phone, $code)
	{
		if ($channel_type == 0) {
			return (new \app\common\aliyun\Sms($config))->code($phone, $code);
		} elseif ($channel_type == 1) {
			return (new \app\common\tencentcloud\Sms($config))->code($phone, $code);
		} elseif ($channel_type == 2) {
			return \app\common\smsbao\Api::send($config["userName"], $config["apiKey"], $phone, "【" . $config["signName"] . "】您的验证码是" . $code);
		}
	}
	public static function card_buy_deliver($channel_type, $config, $phone, $order_no, $card)
	{
		if ($channel_type == 0) {
			return (new \app\common\aliyun\Sms($config))->card_buy_deliver($phone, $order_no, $card);
		} elseif ($channel_type == 1) {
			return (new \app\common\tencentcloud\Sms($config))->card_buy_deliver($phone, $order_no, $card);
		} elseif ($channel_type == 2) {
			return \app\common\smsbao\Api::send($config["userName"], $config["apiKey"], $phone, "【" . $config["signName"] . "】订单号{$order_no}已付款成功,发货信息为{$card}");
		}
	}
}